<template>
  <!-- 项目设计优化及通过情况-->
  <div class="schemeApproval">
    <title-name title="项目设计优化及通过情况" style="margin-top: 50px"></title-name>
    <a-spin :spinning="loading">
      <div class="table-div">
        <a-table :columns="columns" bordered :pagination="false" :data-source="dataTable"> </a-table>
      </div>
    </a-spin>
  </div>
</template>
<script>
import {queryDesignList} from '@/api/design/monthlyReport/monthlyWorkReport'
export default {
  name: 'a' + Date.now(),
  props: {
    id: {
      type: String,
      default() {
        return ''
      }
    },
  },
  data() {
    this.columns = [
      {
       title: '序号',width: '80px',
       customRender(text, record, index) {
       return index + 1
      }
     },
      { title: '分公司', dataIndex: 'branchCompany', align: 'center',},
      { title: '项目名称', dataIndex: 'projectName', align: 'center',},
      { title: '立项数', dataIndex: 'projectDesignNum', align: 'center',
       customRender(text, record, index) {
        let str = text!=null? text + '项':'';
       return str
      }},
      { title: '立项金额', dataIndex: 'projectDesignAmount', align: 'center',
        customRender(text, record, index) {
        let str = text!=null? text + '万元':'';
        return str
        }},
      { title: '通过情况', dataIndex: 'designPastNum', align: 'center',
       customRender(text, record, index) {
        let str = text!=null? text + '项':'';
        return str
        }}
    ]
    return {
      loading: false,
      dataTable:[]
    }
  },
  watch:{
    id: {
      handler(val) {
        this.queryDesignListFn(val);
      },
      immediate: true
    },
  },
  methods: {
    queryDesignListFn(id){
      this.loading = true;
      queryDesignList({id:id}).then((res)=>{
        if(res.code == '200'){
          this.loading = false;
          this.dataTable = res.data;
        }
      }).catch(() => {
          this.loading = false
          this.$message.warning(err.data.message)
        })
    }
  },
  mounted() {}
}
</script>
<style lang="less" scoped>
   ::v-deep.titleName{
    margin-top:10px!important;
  }

</style>

    